package J1_6;

import java.util.Scanner;

public class J106task1 {
    public static void main(String[] args) {
        int year,money;
        int data = 0;
        Scanner scanner =new Scanner(System.in);
        System.out.printf("输入年份:");
        year=scanner.nextInt();
        System.out.printf("输入月份:");
        money=scanner.nextInt();
        switch (money){
            case 12: data=31; break;
            case 11: data=30;break;
            case 10: data=31;break;
            case 9 : data=30; break;
            case 8 : data=31;break;
            case 7 : data=31;break;
            case 6 : data=30; break;
            case 5 : data=31;break;
            case 4 : data=30; break;
            case 3 : data=31;break;
            case 2 : if (money%100!=0&&money%4==0&&money%400==0) 
                        data=29;
                    else 
                        data=28;
                    break;
            case 1 : data=31;break;
            default:
                System.out.println("月份输入错误");
        }
        System.out.println(money+"月共有"+data+"天");
    }
}
